import net.sourceforge.pinyin4j.PinyinHelper

class People(var name:String, var pinyin:String, var pinyin0:String){
    fun input():People{
        println("请输入中文名")
        val chinaName= scanner.next()
        var pinyin=""
        var pinyin0=""
        for(char in chinaName){
            if( (char.toString().matches(Regex("[\\u4E00-\\u9FA5]")))){
                val a= PinyinHelper.toHanyuPinyinStringArray(char, outputFormat)
                pinyin0=pinyin0+a[0][0]
                pinyin=pinyin+a[0]
            }
        }
        return People(chinaName,pinyin,pinyin0)
    }
}